#ifndef STATUS_H
#define STATUS_H

#include "Common.h"
#include "File.h"

// Status is the class that you populate with status data on the state
// of replication in this peer and its knowledge of the replication
// level within the system.
// The thing required in the Status object is the data as specified in the private section
// The methods shown are examples of methods that we may implement to access such data
// You will need to create methods to populate the Status data.

// what is the fileNumber? is it an index? [question]

typedef struct{
    int fileIndex;
    string fileName;
    int chunk;
    int repLevel;
}Chunk;

class Status {
public:
    Status();
    ~Status();
    Status &operator=(const Status &source_status);

    bool containsFile(string fileName);
    bool containsFileChunk(string fileName, int chunk);
    bool isFileComplete(string fileName, int&chunk);
    int receivedFileChunk(string fileName, int chunk);
    int leaveNetwork();
    int removeNonLocalFiles();
    int receivedSystemChunk(string fileName, int chunk);
    int removeSystemChunk(string fileName, int chunk);

    void display();

    int processListofChunks();
    int sizeOfListOfChunks();
    int getFromListofChunks(Chunk &chunk);
    Chunk *createChunk(int fileIndex, string fileName, int chunk, int replevel);
    int clearListOfChunks();
    int addFile(string fileName, int chunks, bool complete);

    // vector of files
    vector<File*> files;

private:
    list<Chunk *> _listOfChunks;
    bool _isCopy;
    bool _isModified;
};

#endif
